﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="LoginPanel.ascx.vb" Inherits="UserControls_LoginPanel" %>
<asp:UpdatePanel ID="updLogin" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
<ContentTemplate>
<table border="1" cellpadding="0" cellspacing="0" class="LoginTable">
<tr>
<td>
<!-- Login Panel Starts Here -->
<asp:Panel ID="pnlLogin" runat="server" Visible="true">
<table class="LoginTable">
<tr>
 <td>Username:</td>
 <td style="width:5px;"></td>
 <td style="width: 130px"><asp:TextBox ID="txtUserName" runat="server" Width="130px"></asp:TextBox></td>
 <td style="width:15px;">
 <asp:RequiredFieldValidator ID="rfvUsername" runat="server" ControlToValidate="txtUserName"
        ErrorMessage="Username Required" ValidationGroup="LogginGroup" Width="7px" Display="Dynamic">*</asp:RequiredFieldValidator>
     <asp:RegularExpressionValidator ID="revUsername" runat="server" ControlToValidate="txtUserName" ValidationGroup="LogginGroup" Display="Dynamic">*</asp:RegularExpressionValidator>
 </td>
</tr>
<tr>
 <td>Password:</td>
 <td style="width:5px;"></td>
 <td style="width: 130px"><asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Width="130px"></asp:TextBox></td> 
 <td style="width:15px;">
   <asp:RequiredFieldValidator ID="rfvPassword" runat="server" ControlToValidate="txtPassword"
        ErrorMessage="Password Required" ValidationGroup="LogginGroup" Display="Dynamic">*</asp:RequiredFieldValidator>
   <asp:RegularExpressionValidator ID="revPassword" runat="server" ControlToValidate="txtPassword" ValidationGroup="LogginGroup" Display="Dynamic">*</asp:RegularExpressionValidator>     
 </td>
 </tr>
 <tr>
  <td colspan="4" style="text-align:center;"><asp:Button runat="server" ID="btnLogin" Text="Login" OnClick="btnLogin_Click" ValidationGroup="LogginGroup"/></td>
 </tr>
 <tr>
  <td colspan="3">
     <asp:ValidationSummary ID="vsLogin" runat="server" HeaderText="The following field(s) are required." ValidationGroup="LogginGroup" Font-Size="Smaller" ShowMessageBox="True" ShowSummary="False" />
  </td>
 </tr>
</table>
</asp:Panel>
<!-- Welcome Panel Starts Here -->
<asp:Panel ID="pnlWelcome" runat="server" Visible="false">
<table class="LoginTable">
<tr>
 <td>Welcome: </td>
 <td style="width: 130px"><asp:Literal ID="ltName" runat="server"></asp:Literal></td>
 <td style="width:15px;"><asp:Button ID="btnLogout" runat="server" OnClick="btnLogout_Click" Text="Logout" /></td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
<tr>
 <td class="LoginBoxMsg">
   <asp:Label CssClass="loginErrors" ID="lblMessage" runat="server"></asp:Label>
 </td>
</tr>
</table>
 </ContentTemplate>
<Triggers>
 <asp:AsyncPostBackTrigger ControlID="btnLogin" EventName="Click" />
 <asp:AsyncPostBackTrigger ControlID="btnLogout" EventName="Click" />
</Triggers>
 </asp:UpdatePanel>  